package com.ybkj.daijia.server.service;

import com.ybkj.daijia.page.Page;
import com.ybkj.daijia.server.model.DriverPaymentsRecord;
import java.math.BigDecimal;
import java.util.Date;
import java.util.List;
import java.util.Map;

/**
 * @author Shine
 */
public interface DriverPaymentsRecordService {

    /**
     * 保存司机充值信息
     *
     * @return
     */
    public DriverPaymentsRecord insertRecord(DriverPaymentsRecord record);

    /**
     * 根据主键查询司机充值信息
     *
     * @param id
     * @return
     */
    public DriverPaymentsRecord findOne(Long id);

    /**
     * 查询app首页数据
     *
     * @return
     */
    public List<DriverPaymentsRecord> listIndexPayments(Long driverId, Date start, Date end);

    public Page<DriverPaymentsRecord> queryByEmploy(Long driverId, String recordType,
        Integer rcType, Date start, Date end, Integer page, Integer limit);

    /****
     * 和 queryByEmploy 不同之处在与支持多个recordType
     * @param driverId
     * @param rcType
     * @param start
     * @param end
     * @param page
     * @param limit
     * @param recordType
     * @return
     */
    public Page<DriverPaymentsRecord> queryByEmployRecordTypes(Long driverId, Integer rcType,
        Date start, Date end, Integer page, Integer limit, String... recordType);

    /****
     * 合并db中的dj_helppay_record和dj_driver_payment_record
     * @param driverId
     * @param recordType
     * @param rcType
     * @param start
     * @param end
     * @param page
     * @param limit
     * @return
     */
    public Page<Map<String, Object>> queryByEmply2(Long driverId, String recordType, Integer rcType,
        Date start, Date end, Integer page, Integer limit);

    public List<DriverPaymentsRecord> listByEmploy(Long driverId, String recordType, Integer rcType,
        Date start, Date end);

    public BigDecimal sumInComeByEmployWithDate(Long driverId, Date begin, Date end);

    public BigDecimal sumRebateByEmployWithDate(Long driverId, Date begin, Date end);

    public DriverPaymentsRecord findOrderRecharge(Long driverId, Long orderId, Integer orderType);

}
